<template>
  <div>
    <table>
      <thead>
        <th>编号</th>
        <th>品牌名称</th>
        <th>创立时间</th>
        <th>操作</th>
      </thead>
      <tbody>
        <tr v-for="(obj,index) in arry" :key=obj.id>
          <td>{{obj.id}}</td>
          <td>{{obj.name}}</td>
          <td>{{obj.time}}</td>
          <td><button @click="del(index)">{{obj.caozuo}}</button></td>
        </tr>
      <tr>
      <td colspan="4">没有数据喽~</td>
      </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
export default {
  data(){
    return{
      arry:[
        {id:1,name:"奔驰",time:'2021-02-01',caozuo:'删除'},
        {id:2,name:"宝马",time:'2021-02-02',caozuo:'删除'},
        {id:3,name:"大众",time:'2021-02-03',caozuo:'删除'},
      ]
    }
  },
  methods:{
    del(i){
    this.arry.splice(i,1)
    }
  }

}
</script>

<style>
table{
  width: 400px;
  text-align: center;
  border-collapse: collapse
}
thead{
  background-color: #8df;
}
table,th,tbody,tr,td{
  border:1px solid black;
  height: 30px;
  
}
</style>